package cn.kk.Blog.dao;
/*
 *@author KK on 2022.12.03 10:41
 */

import cn.kk.Blog.core.utils.DBUtils;
import cn.kk.Blog.entity.TUser;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.util.List;

public class UserDaoImpl implements IUserDao {
    QueryRunner qr = new QueryRunner(DBUtils.getDataSource());
    @Override
    public Integer insert(TUser tUser) throws Exception {

        return null;
    }

    @Override
    public TUser selectById(Integer id) throws Exception {
        return null;
    }

    @Override
    public Integer updateById(TUser tUser) throws Exception {
        return null;
    }

    @Override
    public Integer deleteById(Integer id) throws Exception {
        return null;
    }

    @Override
    public List<TUser> selectList() throws Exception {
        return null;
    }

    @Override
    public Integer batchRemove(List<Integer> ids) throws Exception {
        return null;
    }

    @Override
    public TUser selectByName(String name) throws Exception {
        String sql = "select * from user where username = ? ";
        return qr.query(sql,new BeanHandler<TUser>(TUser.class),name);
    }
}
